﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace loginSQL.Pages
{
    public abstract class AbstractPage
    {
        /// <summary>
        /// Image for printing
        /// </summary>
        public Image pageImage {get;set;}
        /// <summary>
        /// Point of Drawing 
        /// </summary>
        public List<PointF> pointArray = new List<PointF>();

        /// <summary>
        /// Data That will be printed
        /// </summary>
        public List<String> dataList = new List<string>();

        /// <summary>
        /// Drop
        /// </summary>
        protected RectangleF boundRect;

        /// <summary>
        /// Init the Image
        /// </summary>        
        public abstract void init();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        public abstract void Draw(Graphics g);

        /// <summary>
        /// Move by X
        /// </summary>
        /// <param name="moveX"></param>
        public abstract void movePixelX(int moveX);

        /// <summary>
        /// move By Y
        /// </summary>
        /// <param name="moveY"></param>
        public abstract void movePixelY(int moveY);

        /// <summary>
        /// move by X and Y
        /// </summary>
        /// <param name="moveX"></param>
        /// <param name="moveX"></param>
        public abstract void movePixelXY(int moveX,int moveY);

        public bool isHovered(float X, float Y)
        {            
            return (boundRect.IntersectsWith(new RectangleF(X,Y,1,1)));
        }

        public float getTopLeftX()
        {
            return boundRect.X;
        }

        public float getTopLeftY()
        {
            return boundRect.Y;
        }

        public abstract Image getPrintReadyImage();
    }
}
